﻿CREATE proc sp_themvattu
@TenVT nvarchar(200),
@DVT char,
@MaNhomVT int,
@MaDV char
as
declare @dem as int
select @dem=count(*) from DanhMuc_VatTu where TenVT=@TenVT
if(@dem=0)
	begin
	insert into DanhMuc_VatTu(TenVT,DVT,MaNhomVT,MaDV)
	values (@TenVT,@DVT,@MaNhomVT,@MaDV)
	select ErrCode=1
	end
else
	begin
	select ErrCode=0
	end